package com.project_test.kun.travelling_1st.HomePage.category;

import org.json.JSONException;
import org.json.JSONObject;

import java.io.Serializable;

/**
 * Created by Administrator on 16-10-17.
 */
public class HomePCarTypeListItem implements Serializable{

    private int id;
    private String title;
    private int pid;
    private int icon;
    private String description;
    private int sort;

    public void pashJsonObject(JSONObject json) throws JSONException {
//        "id": "107",
        id = json.getInt("id");
//                "title": "越野SUV",
        title = json.getString("title");
//                "pid": "104",
        pid = json.optInt("pid");
//                "icon": "0",
        icon = json.optInt("icon");
//                "description": "",
        description = json.optString("description");
//                "sort": "0"
        sort = json.optInt("sort");
    }

    public int getId() {
        return id;
    }

    public String getTitle() {
        return title;
    }

    public int getPid() {
        return pid;
    }

    public int getIcon() {
        return icon;
    }

    public String getDescription() {
        return description;
    }

    public int getSort() {
        return sort;
    }

    @Override
    public String toString() {
        return "HomePCarTypeListItem{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", pid=" + pid +
                ", icon=" + icon +
                ", description='" + description + '\'' +
                ", sort=" + sort +
                '}';
    }
}
